Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Collections.​ObjectModel.​ReadOnlySet<​T>
Assembly: System.Runtime
Inheritance: object → ReadOnlySet
Implemented Interfaces
- Generic.​IReadOnlySet`1 (Inherits: IEnumerable<​T>IEnumerableIReadOnlyCollection<​T>)
- Generic.​ISet`1 (Inherits: ICollection<​T>IEnumerable<​T>IEnumerable)
- ICollection (Inherits: IEnumerable)
Represents a read-only, generic set of values.
Properties
public
int
Count
Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1" /> .
public static
ReadOnlySet<​T>
Empty
Gets an empty <see cref="T:System.Collections.ObjectModel.ReadOnlySet`1" /> .
protected
Generic.​ISet<​T>
Set
Gets the set that is wrapped by this <see cref="T:System.Collections.ObjectModel.ReadOnlySet`1" /> object.
Methods
public
bool
Contains​(T item)
Determines whether the <see cref="T:System.Collections.Generic.ICollection`1" /> contains a specific value.
Returns <see langword="true" /> if <paramref name="item" /> is found in the <see cref="T:System.Collections.Generic.ICollection`1" /> ; otherwise, <see langword="false" /> .
item
The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1" /> .
public
Generic.​IEnumerator<​T>
GetEnumerator​()
Returns an enumerator that iterates through the collection.
Returns An enumerator that can be used to iterate through the collection.
public
bool
IsProperSubsetOf​(Generic.​IEnumerable<​T> other)
Determines whether the current set is a proper (strict) subset of a specified collection.
Returns <see langword="true" /> if the current set is a proper subset of other; otherwise <see langword="false" /> .
other
The collection to compare to the current set.
public
bool
IsProperSupersetOf​(Generic.​IEnumerable<​T> other)
Determines whether the current set is a proper (strict) superset of a specified collection.
Returns <see langword="true" /> if the collection is a proper superset of other; otherwise <see langword="false" /> .
other
The collection to compare to the current set.
public
bool
IsSubsetOf​(Generic.​IEnumerable<​T> other)
Determines whether the current set is a subset of a specified collection.
Returns <see langword="true" /> if the current set is a subset of other; otherwise <see langword="false" /> .
other
The collection to compare to the current set.
public
bool
IsSupersetOf​(Generic.​IEnumerable<​T> other)
Determines whether the current set is a super set of a specified collection.
Returns <see langword="true" /> if the current set is a subset of other; otherwise <see langword="false" /> .
other
The collection to compare to the current set.
public
bool
Overlaps​(Generic.​IEnumerable<​T> other)
Determines whether the current set overlaps with the specified collection.
Returns <see langword="true" /> if the current set and other share at least one common element; otherwise, <see langword="false" /> .
other
The collection to compare to the current set.
public
bool
SetEquals​(Generic.​IEnumerable<​T> other)
Determines whether the current set and the specified collection contain the same elements.
Returns <see langword="true" /> if the current set is equal to other; otherwise, <see langword="false" /> .
other
The collection to compare to the current set.
public
bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj
The object to compare with the current object.
protected
void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public
int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public
Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public
string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.